{template "topic_header"}

<!--{if $this->Config[ad_enable] && $this->Config[ad][ad_list][vote][header]}-->
<!--{eval SetADV('vote','header');}-->
<!--{/if}-->

<link href="styles/vote.css" rel="stylesheet" type="text/css" />
<div class="main">  
  <div class="mainWrap Wrapbg">	
    <div class="contentWrap">
        <div class="Listmain">
		<!--投票介绍 Begin--> 
		<div id="vote_desc_wp" class="vote_viewT">
			<div class="vote_viewR">
				<div>
					<strong id="vote_subject_wp">{$vote['subject']}</strong>
					<span style="color:#999; font-size:12px;">
					<!--{if $vote['multiple']}-->
						(最多可选{$vote['maxchoice']}项)
					<!--{else}-->
						(单选)
					<!--{/if}-->
					</span>

					<!--{if $vote[from_html]}--><br>
					<span style="color:#999999; font-size:12px;">
					  {$vote[from_html]}
					</span>
					<!--{/if}-->
				</div>

			<p class="vote_validity">
			<span class="vote_date">有效期：<!--{eval echo my_date_format($vote['dateline'], 'Y年m月d日 H:i')}-->&nbsp;--&nbsp;<!--{eval echo my_date_format($vote['expiration'], 'Y年m月d日 H:i')}--></span>
			</p>
            
            <div class="vote_num2"><b>$vote['voter_num']</b></div>
			</div>
			<div class="clear"></div>
		</div>
		<!--投票介绍 End-->
			
		<!--投票主体 Begin-->
				<div class="vote_viewE">
					<!--{if $vote[uid]==MEMBER_ID || 'admin'==MEMBER_ROLE_TYPE}-->
						<a href="javascript:;" onclick="deleteVote({$vote[vid]});">删除这个投票</a> |
						<a href="javascript:;" onclick="showModifyVoteExpirationDialog({$vote[vid]});">修改截止时间</a> |
						<a href="javascript:;" onclick="showEditVoteDialog({$vote[vid]});">编辑投票</a> | 
					<!--{/if}-->
						<a href="javascript:;" onclick="showRecommendVoteDialog({$vote[vid]},{'subject_wp':'vote_subject_wp'});">分享到{$this->Config[changeword][p_weibo]}</a> 
				</div>
			<div id="vote_main_wp">
            
            	<!--{if !$vote['is_view'] && !$hasvoted &&!$expiration}-->
				<div class="vote_tips">结果投票后可见</div>
				<!--{/if}-->
            	<!--{if $expiration}-->
				<div class="vote_tips">投票已经结束</div>
				<!--{/if}-->
            
				<!--{if $vote['message']}--><p class="poll_depiction">{$vote['message']}</p><!--{/if}-->
				<!--{if $vote['img']}--><p><img src="{$vote['img']}" width="600"></p><!--{/if}-->
				<form name="vote_form" method="post" action="ajax.php?mod=vote&code=vote&vid=$vote['vid']&from=topic" id="vote_form">
				
				<!--投票选项 Begin-->
					<!--{template "vote_options"}-->
				<!--投票选项 End-->
				

					<div class="poll_submit">
						<!--{if $allowedvote && !$hasvoted}-->
						<input type="hidden" name="votesubmit" value="true" />
						<span style="width:100px;">
							<label for="follow_view"><input type="checkbox" name="follow_vote" id="follow_view" value="1" style="vertical-align:middle; margin:-1px 0 0 0;" checked="checked">&nbsp;关注更新</label>
						</span>
						<span style="width:100px;">
							<label for="toweibo_view"><input type="checkbox" name="toweibo" id="toweibo_view" value="1" style="vertical-align:middle; margin:-1px 0 0 0;" checked="checked" onclick="chc_vote('toweibo');">&nbsp;分享到{$this->Config[changeword][p_weibo]}</label>
						</span> 
						<span style="width:100px;">
							<label for="anonymous_view"><input type="checkbox" name="anonymous" id="anonymous_view" value="1" style="vertical-align:middle;margin:-1px 0 0 0;" onclick="chc_vote('anonymous');">&nbsp;匿名</label>
						</span> 
						<input type="button" class="vote_btn" id="save" value="投 票" onclick="vote();"/>
						<input type="hidden" id="check_PublishBox_uid" name="check_PublishBox_uid" value="{$uid}">
						<!--{else}-->
						<!--{if $allowedvote}-->
						<span style="width:100px;margin-right:50px;">
							<label for="follow_view"><input type="checkbox" id="follow_view" value="1" style="vertical-align:middle; margin:-1px 0 0 0;" {if $hasfollowed}checked="checked"{/if} onclick="mod_follow_vote(this.checked,'{$uid}','{$vid}');">&nbsp;关注更新</label>
						</span>
						<!--{/if}-->
						<!--{if $hasvoted}-->
						<input type="submit" class="canlText" id="save" value="已投票"  disabled="disabled"/>
						<!--{/if}-->
						<!--{/if}-->
					</div>

				</form>
			</div>
			
		<!--投票主体 End-->
		
		<!--其他人的投票 Begin-->         
        <div class="Menulink">
        <A id="one1" href="javascript:void(0);" class="selected" onclick="setTab('one',1,2);getVoteJoined(1,{c:1});">大家的最新投票</A>
        <!--{if MEMBER_ID>0}--><A id="one2" href="javascript:void(0);" onclick="setTab('one',2,2);getVoteJoined(1,{c:2});">关注人的最新投票</A><!--{/if}-->
        </div>
        
		<div id="con_one_1" class="vote_con"></div>
		<div id="con_one_2" class="vote_con" style="display:none;"></div>

         
		<script language="javascript">
			function chc_vote(obj){
				var	vid = obj=='anonymous' ? 'toweibo_view' : 'anonymous_view';
				document.getElementById(vid).checked = false;
			}
			function getVoteJoined(page, options)
			{
				if (!page) {
					page = 1;
				}
				if ( typeof options == 'undefined') {
					options = {};
				}
				type = '';
				if (options.c) {
					if (options.c == 2) {
						wp = 'con_one_2';
						type = 'follow';
					} else {
						wp = 'con_one_1';
						type = '';
					}
				}
				$('#'+wp).html("<div><center><span class='loading'>正在载入……</span></center></div>");
				var url = "ajax.php?mod=vote&code=joined&vid={$vid}&type="+type+"&page="+page;
				$.get(
					url,
					{},
					function (r) {
						if (is_json(r)) {
							var json = eval('('+r+')');
							$('#'+wp).html(json.msg);
						} else {
							$('#'+wp).html(r);
						}
					}
				);
			}
			$(document).ready(function(){getVoteJoined(1, {c:1});});
		</script>
		<!--其他人的投票 End-->
		
		<script language="Javascript">
			$(document).ready(function(){
				//初始化智能输入框
				initAiInput('app_content');
			});
			function listTopic( s,lh ) {	
				var s = 'undefined' == typeof(s) ? 0 : s;
				var lh = 'undefined' == typeof(lh) ? 1 : lh;
				if(lh) {
					window.location.hash="#listTopicArea";
				}
				var myAjax = $.post(
					"ajax.php?mod=app&code=list_topic",
					{
						<!--{loop $params $k $v}-->
						{$k}:"{$v}",
						<!--{/loop}-->
						start:s
					},
					function (d) {
						$("#listTopicArea").html(d);			
					}
				); 
			}
		</script>
        </div>
         </div>
		<!--{if MEMBER_ID>0}-->
			<!--评论发布框 Begin-->
			<div class="topic_new_add vote_li_send">
				<!--{template "topic_publish"}--> 
			</div>
			<!--评论发布框 End-->
		<!--{/if}-->
        <style type="text/css">
		.topicReply{ padding:0 0 20px; margin-top:10px;box-shadow:none;}

        </style>
        
		<div class="Listmain">
		<div id="listTopicMsgArea"></div>
		<div id="listTopicArea" class="vote_li_list" style="padding:0">
			{template "topic_list_ajax"}
		</div>
		</div>
      
</div>
<!--{subtemplate 'vote_right'}-->
</div>
<!--{if $this->Config[ad_enable]}-->
<!--{eval SetADV('vote','footer');}-->
<!--{/if}-->
{template "topic_footer"}